<template>
	<view class="flex flex-column u-p-b-20 u-m-t-30 bg-white rounded-10">
		<u-cell-item :borderBottom="false" title="我的订单" value="全部订单" @click="orderItemClick(0)" hoverClass="none"></u-cell-item>
    <view class="u-p-x-10">
      <u-grid :col="5" :border="false">
      	<u-grid-item v-for="(item,index) in list" :index="index" :key='index' @click="orderItemClick(index+1)">
      		<u-badge v-if="item.count" :count="item.count" :offset="[0, 22]"></u-badge>
      		<image :src="`/static/submine/order-${index +1}.png`" style="width: 46rpx;height: 46rpx;" mode=""></image>
      		<view class="u-p-t-10">{{item.title}}</view>
      	</u-grid-item>
      </u-grid>
    </view>
		
	</view>
</template>

<script>
	export default {
		name:"mine-order",
		props: {
			list: {
				type: Array,
				default() {
					return []
				}
			},
			orderType: {
				type: Number,
				default() {
					return 1
				}
			}
		},
		methods: {
			orderItemClick(index) {
				if(!this.isLogin) return this._login()
				if(index == 5) {
					uni.navigateTo({
						url: '/pages/order/mineOrderAfter/mineOrderAfter'
					})
					return
				}
				uni.navigateTo({
					url: '/pages/order/mineOrderList/mineOrderList?type=' + index + '&orderType=' +  this.orderType
				})
			},
		}
	}
</script>

<style lang="scss" scoped>

</style>
